<table style="font-size: 8pt; width: 100%;">
    <tr>
		<td style="width: 50%; text-align: left"><img src="<?php echo "http://zsmo.localhost/img/logosmo02.png"; ?>" width="100"></td>    
	</tr>
</table>
<table style="font-size: 12pt; width: 100%;">
	<tr>
		<td style="width: 100%; text-align: center"><b><?php echo strtoupper($this->borrador)?></b></td>
	</tr>
    <tr>
		<td style="width: 100%; text-align: center"><b><?php echo strtoupper($this->arr_doc_pri['dop_tipo'])." : ".$this->arr_doc_pri['dop_numero_identificador']?></b></td>
	</tr>
</table>
<br>
<b>Datos del Documento :</b>	
<table style="width: 100%; border: solid 0.5px black;  font-size: 8pt;">
    <tr>
		<td style="width: 10%; text-align: left">Transporte</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_transporte['ctr_nombre']?></td>
		<td style="width: 10%; text-align: left">Costo</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_transporte['ctr_costo']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Salida</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_transporte['ctr_fecha_salida'].', '.$this->arr_transporte['ctr_ciudad_salida']?></td>
		<td style="width: 10%; text-align: left">Llegada</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_transporte['ctr_fecha_llegada'].', '.$this->arr_transporte['ctr_ciudad_llegada']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Giro :</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_doc_pri['dop_giro']?></td>
		<td style="width: 10%; text-align: left">Emp. Relac</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_doc_pri['dop_empresa_relacionada']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Motivo</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_doc_pri['dop_tipo_motivo']?></td>
		<td style="width: 10%; text-align: left">Obs</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_doc_pri['dop_observacion']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Docto Asoc</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dos['dos_numero_identificador']?></td>
		<td style="width: 10%; text-align: left"></td>
		<td style="width: 40%; text-align: left"></td>
	</tr>
</table>
<br>
<b>Origen :</b>	
<table style="width: 100%; border: solid 0.5px black;  font-size: 8pt;">
    <tr>
		<td style="width: 10%; text-align: left">Señor(es)</td>
		<td style="width: 90%; text-align: left" colspan="3">: <?php echo $this->arr_dest_ori['des_nombre']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Direccion</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_ori['des_direccion']?></td>
		<td style="width: 10%; text-align: left">Comuna</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_ori['des_comuna']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Ciudad</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_ori['des_ciudad']?></td>
		<td style="width: 10%; text-align: left">Rut</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_ori['des_rut']?></td>
	</tr>
</table>
<br>
<b>Llegada:</b>	
<table style="width: 100%; border: solid 0.5px black;  font-size: 8pt;">
	<tr>
		<td style="width: 10%; text-align: left">Señor(es)</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_lle['des_nombre']?></td>
		<td style="width: 10%; text-align: left">Fecha</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_doc_pri['dop_fecha']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Direccion</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_lle['des_direccion']?></td>
		<td style="width: 10%; text-align: left">Comuna</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_lle['des_comuna']?></td>
	</tr>
	<tr>
		<td style="width: 10%; text-align: left">Ciudad</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_lle['des_ciudad']?></td>
		<td style="width: 10%; text-align: left">Rut</td>
		<td style="width: 40%; text-align: left">: <?php echo $this->arr_dest_lle['des_rut']?></td>
	</tr>
</table>
<br>
<b>Detalle:</b>
<table style="width: 100%; border: solid 0.5px black;  font-size: 8pt; ">
	<tr >
		<td style="width: 15%; text-align: left">Codigo</td>
		<td style="width: 15%; text-align: left">Articulo</td>
		<td style="width: 10%; text-align: left">Color</td>
		<td style="width: 30%">Tallas y Cant</td>
		<td style="width: 10%; text-align: left" >Cant Cajas</td>
		<td style="width: 10%; text-align: left">Cant Merc</td>
		<td style="width: 10%; text-align: center">Monto</td>
	</tr>
	<?php
	foreach($this->arr_det as $det){
		?>
		<tr>
			<td style="width: 15%; text-align: left"><?php echo $det['mer_codigo']?></td>
			<td style="width: 15%; text-align: left"><?php echo $det['mer_articulo']?></td>
			<td style="width: 10%; text-align: left"><?php echo $det['col_nombre']?></td>
			<td style="width: 30%; ">
				<table style="width: 100%">
					<tr>
						<?php
							foreach($det['talla'] as $talla){
								?>
								<td style="width: 10%; text-align: right"><?php echo $talla?></td>		
								<?php
							}
						?>			
					</tr>
				</table>
			</td>
			<td style="width: 10%; text-align: right"></td>
			<td style="width: 10%; text-align: right"></td>
			<td style="width: 10%; text-align: right"><?php echo "$ ".number_format($det['mer_costo'],0,',','.')?></td>
		</tr>
		<tr>
			<td style="width: 15%; text-align: left"></td>
			<td style="width: 15%; text-align: left"></td>
			<td style="width: 10%; text-align: left"></td>
			<td style="width: 30%; ">
				<table style="width: 100%">
					<tr>
						<?php
							foreach($det['inv_cantidad'] as $cant){
								?>
								<td style="width: 10%; text-align: right"><?php echo $cant?></td>		
								<?php
							}
						?>			
					</tr>
				</table>
			</td>
			<td style="width: 10%; text-align: right"></td>
			<td style="width: 10%; text-align: right"></td>
			<td style="width: 10%; text-align: right"></td>
		</tr>
		<?php
	}
	?>
</table>
<br>
<b>Totales:</b>
<table style="width: 100%; border: solid 0.5px black;  font-size: 8pt;">
	<tr>
		<td style="width: 80%; text-align: right">Total :</td>
		<td style="width: 20%; text-align: right"> <?php echo "$ ".number_format($this->arr_doc_pri['dop_monto_total'],0,',','.')?></td>
	</tr>
	<tr>
		<td style="width: 80%; text-align: right">Iva :</td>
		<td style="width: 20%; text-align: right"> <?php echo number_format($this->arr_doc_pri['dop_iva'],2,',','.')." %"?></td>
	</tr>
	<tr>
		<td style="width: 80%; text-align: right">Descto :</td>
		<td style="width: 20%; text-align: right"> <?php echo number_format($this->arr_doc_pri['dop_descuento_porcentaje_total'],2,',','.')." %"?></td>
	</tr>
	<tr>
		<td style="width: 80%; text-align: right">Total Final :</td>
		<td style="width: 20%; text-align: right"> <?php echo "$ ".number_format($this->arr_doc_pri['dop_monto_total_calculado'],0,',','.')?></td>
	</tr>
</table>
